package webTest.sessionCookie.LastView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by IFT8 on 2015/1/26.
 */
public class BookDAO {
    private BookDAO() {

    }

    private static Map<String, Book> books = new HashMap<String, Book>();

    static {
        books.put("1", new Book("1", "三国演义", "朴乾", "黑马出版社", 998.00, "黑马出版社倾情奉献，3个男人解不开的纠缠。。。"));
        books.put("2", new Book("2", "西游记", "郭富城", "人民教育出版社", 8.00, "一个男人、一头猪和一个猴子一个挑夫上西天的故事。。。"));
        books.put("3", new Book("3", "水许传", "刘欢", "传智出版社", 10.00, "105个男人和3个女人闯天下的故事。。。"));
        books.put("4", new Book("4", "红楼梦", "哈利波特", "凤凰传奇版社", 100.00, "一群女人的故事。。。。"));
    }

    public static Map<String, Book> getBooks() {
        return books;
    }

    public static Book getBook(String id) {
        return getBooks() != null ? getBooks().get(id) : null;
    }
}
